package vn.qnamuni.calendar.reciever;

import vn.qnamuni.calendar.constants.PersonContract;
import vn.qnamuni.calendar.services.MyAlarmService;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

/*
 * As stated earlier, we need to create a BroadcastReceiver
 *  that will that receive Intents. I have named my receiver class as MyReceiver.
 */

//must register service and receiver
public class AlarmReciever extends BroadcastReceiver {

	@Override
	public void onReceive(Context context, Intent intent) {
		// alarm service
		Intent service1 = new Intent(context, MyAlarmService.class);
		service1.putExtra(PersonContract.Entry.KEY_ID,
				intent.getIntExtra(PersonContract.Entry.KEY_ID, -1));
		service1.putExtra("mode", intent.getIntExtra("mode", -1));
		context.startService(service1);
	}
}
